/*
 * bill.h
 *
 *  Created on: Dec 26, 2013
 *      Author: killerg
 */

#ifndef BILL_H_
#define BILL_H_

#include "server_session.h"
#include "server_mgr.h"


struct http_server;
struct my_clock_t;
struct db_mgr_t;
struct bill_console_t;
struct bill_cfg_t;
struct code_t;
struct SvcData;
struct bill_t {
    server_mgr_t* svrmgr;
    serversess_mgr_t* sessmgr;
    my_clock_t* clock;
    http_server* https;
    db_mgr_t* db;
    bill_console_t* console;
    bill_cfg_t* cfg;
    code_t* code;
    SvcData* svcdata;

    bool init(SvcData* svcdata_);
    void destroy();
    void loop();
};

extern bill_t g_bill;

#define g_svrmgr g_bill.svrmgr
#define g_sessmgr g_bill.sessmgr
#define g_https g_bill.https
#define g_db g_bill.db
#define g_console g_bill.console
#define g_cfg g_bill.cfg
#define g_clock g_bill.clock

#endif /* BILL_H_ */
